home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_05
/
1005076a
< prev
next >
Wrap
Text File
|
1991-09-24
|
384b
|
22 lines
/*
* main.c - main to test the stack abstraction
*/
#include <stdio.h>
#include <assert.h>
#include <stack.h>
char *some_pointer = "some data";
void main() {
STK *stk;
stk = StkConstruct();
assert(StkIsEmpty(stk));
StkPush(stk, some_pointer);
assert(!StkIsEmpty(stk));
assert(StkPop(stk) == some_pointer);
assert(StkIsEmpty(stk));
StkDestroy(stk);
}